/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"23EAA07F-8C1E-46B3-8349-646238F96B21"}
 */
function accion(event) {
	
	if (adm_t300_perfiles_menus_to_adm_t900_menus__menus.adm_t900_menus_padre_id == null){
		foundset.loadRecords(scopes.adm_t300_perfiles_menus.mostrar_menu(foundset.getSelectedRecord()));
	}else{
		if (adm_t300_perfiles_menus_to_adm_t900_menus__menus.adm_t900_tablas_id != null){
			scopes[adm_t300_perfiles_menus_to_adm_t900_menus__menus.adm_t900_menus_to_adm_t900_tablas.s_nombre_tabla].menu_navigator();
		}
	}
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @private
 *
 * @properties={typeid:24,uuid:"A8784008-8B98-4AE4-B952-2294BF47C3CB"}
 */
function onRenderTexto(event) {

	/** @type {JSRecord<db:/pigeon_board/adm_t300_perfiles_menus>} */
	var record = event.getRecord();
	if (record && record.adm_t300_perfiles_menus_to_adm_t900_menus__menus.adm_t900_menus_padre_id != null) {
		event.getRenderable().bgcolor = '#BBB';
	} else  {
		event.getRenderable().bgcolor = '#888';
	}
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @private
 *
 * @properties={typeid:24,uuid:"11395394-F4A0-4FAE-A7AC-70701D19F40C"}
 */
function onRenderFlecha(event) {

	/** @type {JSRecord<db:/pigeon_board/adm_t300_perfiles_menus>} */
	var record = event.getRecord();
	if (record && record.adm_t300_perfiles_menus_to_adm_t900_menus__menus.adm_t900_menus_padre_id != null) {
		event.getRenderable().imageURL = null;
		event.getRenderable().bgcolor = '#BBB';
	} else  {
		event.getRenderable().imageURL = "media:///iconos/ic_play_arrow_white_18dp.png";
		event.getRenderable().bgcolor = '#888';
	}
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @private
 *
 * @properties={typeid:24,uuid:"73AEB054-AE2E-40E5-BFDF-697F6F5A5A51"}
 */
function onRenderIcono(event) {

	/** @type {JSRecord<db:/pigeon_board/adm_t900_menus>} */
	var record = event.getRecord();
	if (record && record.adm_t900_menus_padre_id != null) {
		if (record && record.s_icono != null){
			event.getRenderable().imageURL = record.s_icono;
		}
		event.getRenderable().bgcolor = '#BBB';
	} else  {
		if (record && record.s_icono != null){
			event.getRenderable().imageURL = record.s_icono;
		}
		event.getRenderable().bgcolor = '#888';
	}
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"8B0E719F-6C00-4191-9BDB-14CA9B7228B5"}
 * @AllowToRunInFind
 */
function onShow(firstShow, event) {

	foundset.sort("adm_t300_perfiles_menus_to_adm_t900_menus__menus.n_orden asc");
}
/**
 * Callback method when form is (re)loaded.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"2AB782EC-CDA0-45BD-9401-42EECE54C51F"}
 */
function onLoad(event) {

	scopes.adm_t300_perfiles_menus.mostrar_menu();
}
